package com.shenzhen.horselive.ui.activity;

import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.Fragment;

import android.os.Bundle;

import com.shenzhen.horselive.R;
import com.shenzhen.horselive.adapter.MyViewPageAdapter;
import com.shenzhen.horselive.base.AppBarActivity;
import com.shenzhen.horselive.databinding.ActivityFenZhiDuiBinding;
import com.shenzhen.horselive.ui.fragment.KuangDuiFragment;
import com.shenzhen.horselive.ui.fragment.RedGuDuiFragment;

import java.util.ArrayList;
import java.util.List;

public class FenZhiDuiActivity extends AppBarActivity {

    ActivityFenZhiDuiBinding  binding;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        binding = ActivityFenZhiDuiBinding.inflate(getLayoutInflater());
        setContentView(binding.getRoot());
        setStyleDark();
        setTitle("蜂值兑换");
        initViews();
    }

    private void initViews() {
        List<Fragment>  list =new ArrayList<>();
        list.add(RedGuDuiFragment.newInstance());
        list.add(new KuangDuiFragment());

        List<String>  titles =new ArrayList<>();
        titles.add("兑换红包股");
        titles.add("兑换矿石");

        MyViewPageAdapter  adapter =  new MyViewPageAdapter(getSupportFragmentManager(),list,titles);
        binding.viewpage.setAdapter(adapter);
        binding.tabs.setupWithViewPager(binding.viewpage);
    }
}